/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import type.VendorType;

/**
 *
 * @author wei
 */
@Entity(name="Vendor")
public class VendorEntity extends PersonEntity implements Serializable {
    private String companyName;
    private String jobTitle;
    private String bankAccount;

    public String getBankAccount() {
        return bankAccount;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }
    @ManyToMany(mappedBy="vendor")
    private Collection<RawMaterialEntity> rms;

    public Collection<RawMaterialEntity> getRms() {
        return rms;
    }

    public void setRms(Collection<RawMaterialEntity> rms) {
        this.rms = rms;
    }
 
    @OneToMany
    private Collection<RawMaterialPurchaseOrderEntity> rawMaterialPurchases;
    private VendorType vendorType;

    public VendorType getVendorType() {
        return vendorType;
    }
    @OneToMany(mappedBy="vendor")
    private Collection<RawMaterialQuotationEntity> rawMaterialQuotation;
    public void setVendorType(VendorType vendorType) {
        this.vendorType = vendorType;
    }

    public Collection<RawMaterialQuotationEntity> getRawMaterialQuotation() {
        return rawMaterialQuotation;
    }

    public void setRawMaterialQuotation(Collection<RawMaterialQuotationEntity> rawMaterialQuotation) {
        this.rawMaterialQuotation = rawMaterialQuotation;
    }
    public VendorEntity() {
        super();
    }
    
    private double star;

    public double getStar() {
        
        return star;
    }

    public void setStar(double star) {
        this.star = star;
    }
    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getJobTitle() {
        return jobTitle;
    }

    public void setJobTitle(String jobTitle) {
        this.jobTitle = jobTitle;
    }


    public Collection<RawMaterialPurchaseOrderEntity> getRawMaterialPurchases() {
        return rawMaterialPurchases;
    }

    public void setRawMaterialPurchases(Collection<RawMaterialPurchaseOrderEntity> rawMaterialPurchases) {
        this.rawMaterialPurchases = rawMaterialPurchases;
    }


    public String rootToString() {
        return "VendorEntity{" + "companyName=" + companyName + ", jobTitle=" + jobTitle  + ", rms=" + rms + ", vendorType=" + vendorType + ", rawMaterialQuotation=" + rawMaterialQuotation + ", star=" + star + '}';
    }

  
    
}
